﻿ /**
 * 
 * @file FITKAcousticsHDF5Writer.h
 * @brief 声学HDF5文件写出
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-12-13
 * 
 */
#ifndef _FITK_ACOUSTICS_HDF5_WRITER_H___
#define _FITK_ACOUSTICS_HDF5_WRITER_H___

#include "FITK_Interface/FITKInterfaceIO/FITKAbstractHDF5Writer.h"


namespace Acoustics
{
    class FITKAcousticsDiscModel;
    class FITKAcousticsPhysics;
    class FITKAcousticsGeometryData;
    class FITKAcousticsPostData;
    class FITKAcousticsGroupManager;
}

namespace IO
{
    class FITKAcousticsHDF5IOInterface;
    /**
     * @brief 声学HDF5文件写出
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-11
     */
    class FITKAcousticsHDF5Writer : public IO::FITKAbstractHDF5Writer
    {
    public:
        /**
         * @brief Construct a new FITKVAOneXMLWriter object
         * @param[i]  interface      组件指针，可传递参数
         * @param[o]  isSuccess      是否执行成功
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-11
         */
        explicit FITKAcousticsHDF5Writer(FITKAcousticsHDF5IOInterface* interface, bool & isScuccess);
        /**
         * @brief Destroy the FITKVAOneXMLWriter object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-11
         */
        virtual ~FITKAcousticsHDF5Writer() = default;
        /**
         * @brief 执行写出
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-11
         */
        void run() override;

        /**
         * @brief 打印控制台消息
         * @param[i] level 打印级别 1 normal 2 warning 3error
         * @param[i] str 打印的信息
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-08
         */
        void consoleMessage(int level, const QString& str) override;

    private:
        /**
         * @brief 组件对象指针
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-11
         */
        FITKAcousticsHDF5IOInterface* _compInterface{};
        /**
         * @brief 是否执行成功
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-11
         */
        bool & _isSuccess;
        /**
        * @brief 声学离散模型  
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-10-11
        */
        Acoustics::FITKAcousticsDiscModel* _discModel{};
        /**
         * @brief 声学物理模型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-11
         */
        Acoustics::FITKAcousticsPhysics* _physics{};
        /**
         * @brief几何数据
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2025-02-19
         */
        Acoustics::FITKAcousticsGeometryData *_geoData{};

        /**
         * @brief 分组信息数据管理器
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-24
         */
        Acoustics::FITKAcousticsGroupManager *_groupData{};
        /**
         * @brief声学后处理数据
         * @author yangjing (1195810980@qq.com)
         * @date 2025-02-20
         */
        Acoustics::FITKAcousticsPostData *_postData{};
    private:
        /**
        * @brief写出工程文件版本数据
        * @author yangjing (1195810980@qq.com)
        * @date 2025-02-26
        */
        bool CreateVersion();
    };
}
#endif
